---
sidebar_label: Install / Uninstall
sidebar_position: 3
description: Install the Hasura CLI on Linux, Mac OS, Windows
keywords:
  - hasura
  - hasura cli
  - install
  - linux
  - mac
  - windows
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';

# Install / Uninstall the Hasura CLI

## Install the Hasura CLI

### Install the Hasura CLI binary globally

The recommended installation method of the Hasura CLI is to install it as a global binary. You can download it by
following the instructions for your operating system:

<Tabs groupId="user-preference" className="api-tabs">
<TabItem value="linux" label="Linux">

In your Linux shell, run the following command:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
```

This will install the Hasura CLI in `/usr/local/bin`. You might have to provide your `sudo` password depending on the
permissions of your `/usr/local/bin` location.

If you'd prefer to install to a different location other than `/usr/local/bin`, set the `INSTALL_PATH` variable
accordingly:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=$HOME/bin bash
```

You can also install a specific version of the CLI by providing the `VERSION` variable:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.48.6 bash
```

</TabItem>
<TabItem value="mac" label="Mac">

In your Terminal, run the following command:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
```

This will install the Hasura CLI in `/usr/local/bin`. You might have to provide your `sudo` password depending on the
permissions of your `/usr/local/bin` location.

If you'd prefer to install to a different location other than `/usr/local/bin`, set the `INSTALL_PATH` variable
accordingly:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=$HOME/bin bash
```

You can also install a specific version of the CLI by providing the `VERSION` variable:

```bash
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.48.6 bash
```

</TabItem>
<TabItem value="windows" label="Windows">

Download the binary `cli-hasura-windows-amd64.exe` available under `Assets` of the latest release from the GitHub
release page :

<Link to="https://github.com/hasura/graphql-engine/releases">https://github.com/hasura/graphql-engine/releases</Link>

Rename the downloaded file to `hasura`. You can add the path to the environment variable `PATH` for making `hasura`
accessible globally.

</TabItem>
</Tabs>

:::tip Tip: Add shell completion

To add command auto-completion in your shell, refer to the
[hasura completion](/hasura-cli/commands/hasura_completion.mdx) command.

:::

### Install through npm

The Hasura CLI is available as an [npm package](https://www.npmjs.com/package/hasura-cli) which wraps the compiled
binary and is **independently maintained by members of the community. Hasura does not offer maintenance or support for
this package**.

## Uninstall the Hasura CLI

### Uninstall a binary globally

If you installed the binary directly on your system, delete the binary file from its installation location.

```bash
# By default, the binary is installed at /usr/local/bin/hasura
$ which hasura
  /usr/local/bin/hasura

# use sudo if required
$ rm /usr/local/bin/hasura
```

### Uninstall through npm

Follow the instructions on the [npm package](https://www.npmjs.com/package/hasura-cli) page to uninstall the npm
package.
